package com.jw.qme.controller;

import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import com.jw.qme.service.FriendService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * ClassName: com.jw.qme.controller
 * Datetime: 2025/4/30 下午8:06
 * Description:
 *
 * @author 汪佳泉
 * @version 1.0
 * @since 1.0
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/friend")
public class FriendController {

   private final FriendService friendService;

    @GetMapping("/all")
    public SaResult getFriends(){
        return SaResult.data(friendService.getFriendByUsername((String) StpUtil.getLoginId(),false));
    }

    @GetMapping("/newAll")
    public SaResult getNewFriendMessage(){
        return SaResult.data(friendService.getFriendByUsername((String) StpUtil.getLoginId(), true));
    }

}
